package com.example.pilipili.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author liyv
 * @since 2023-12-01
 */
@Data
public class Comment implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private LocalDate time;

    /**
     * 0：正常
`1：违规
     */
    @Max(1)
    @Min(0)
    private Integer status;

    private Integer vid;
    private Integer uid;

    /**
     * 父评论id
     */
    @TableField(fill = FieldFill.UPDATE)
    private Integer parentId;
    @Size(max = 125 )
    private String content ;

    @Override
    public String toString() {
        return "Comment{" +
        "id=" + id +
        ", time=" + time +
        ", status=" + status +
        ", vid=" + vid +
        ", parentId=" + parentId +
        ", content=" + content +
        "}";
    }
}
